/**  
* @Title: ICommonDAO.java
* @Package com.bj58.zhaopin.activity.dao
* @Description: TODO
* @author yangning02@58.com
* @date 2014-1-10 下午1:31:32
* @Copyright: 2014 www.58.com Inc. All rights reserved.
* @version V1.0  
*/

package com.bj58.migrate.helper.dao;

import java.util.List;
import java.util.Map;

import com.bj58.sfft.utility.dao.basedao.IPreparedStatementHandler;

/**
 * @ClassName ICommonDAO
 * @Description TODO
 * @author yangning02@58.com
 * @date 2014-1-10
 */
public interface ICommonDAO{
	public int getCount(Class clazz, String where) throws Exception;
	public int getCountBySql( String sql, Object... param ) throws Exception;
	public int getCountByParamMap( Class clazz, Map< String, Object > paramMap ) throws Exception;
	public Object getByid(Class clazz,int id) throws Exception;
	public Object getByid(Class clazz,long id) throws Exception;
	public <T> List<T>  getListBySql(Class<T> clazz, String sql, Object... param) throws Exception;
	public Long insert( Object obj ) throws Exception;
	public void update(Object obj) throws Exception;
	public void updateOneField(Class clazz,Object id,String key,String value) throws Exception;
	public int execBySQL( String sql ) throws Exception;
	public < T >List< T > pageListBySql( Class< T > clazz, Map< String, Object > params, String field, int page, int pageSize, String orderBy ) throws Exception;
	public < T >List< T > pageListBySql( Class< T > clazz, String condition, int page, int pageSize, String orderBy ) throws Exception;
	public Object execInsert( String sql, IPreparedStatementHandler handler ) throws Exception;
}

